/**
 * 用电单车产量温度卡
 */
var numberFormate = iot.getNumberFormat("0.00");
//总碳排
dev.action = function(resp,param){
    var jsData =  iot.list();
    var totalUseNum = parseInt(Math.random()*87876756);
    var yieldUseNum = parseInt(Math.random() * 23233);
    var bicycleUseNum = parseInt(totalUseNum/yieldUseNum)
    var Temp = Math.random() * 40;
    var lastPeriod1 = parseInt(Math.random()*100) + '%'
    var lastPeriod2 = parseInt(Math.random()*100) + '%'
    var kpi1 = parseInt(Math.random()*100) + '%'
    var kpi2 = parseInt(Math.random()*100) + '%'

    jsData.add({unit: "kwh", lastPeriod: lastPeriod1, type: "总用电", useNum: totalUseNum, kpi: kpi1});
    jsData.add({unit: "kwh/辆", lastPeriod: lastPeriod2, type: "单车用电", useNum: bicycleUseNum, kpi: kpi2});
    jsData.add({unit: "辆", type: "总产量", useNum: yieldUseNum});
    jsData.add({unit: "℃", type: "平均温度", useNum: numberFormate.format(Temp)});

    resp.setJsData(jsData);
}
